<?php
	$host = '0.0.0.0';
	$port = 9501;

	$serv = new swoole_server($host, $port, SWOOLE_PROCESS, SWOOLE_SOCK_UDP);

	/**
	 * $serv 服务器信息
	 * $data 接受到的数据
	 * $fd 客户端信息
	 */
	$serv->on('packet', function($serv, $data, $fd){
		//发送数据到相应的客户端
		var_dump($fd);
		$serv->sendto($fd['address'], $fd['port'], "Server: $data\n");
	});

	$serv->start();
